package com.example.demo.mapper;

import com.example.demo.entity.Api;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ApiMapper {

    int insertApi(Api api);

    List<Api> findAllByName(@Param(value = "apiName") String apiName);

    List<Api> findAllByApiSuiteId(@Param(value = "apiSuiteId") Integer apiSuiteId);

    List<Api> findAllToPage(@Param(value = "apiSuiteId") Integer apiSuiteId, @Param(value = "projectId") Integer projectId,@Param(value = "apiName") String apiName);

    Api findById(@Param(value = "apiId") int apiId);

    int updateApi(Api api);

    List<Api> findAllByFile(@Param(value = "apiName") String apiName,@Param(value = "projectId") int projectId,@Param(value = "apiSuiteId") int apiSuiteId);

    List<Api> findAll();

    void deleteApi(@Param(value = "id") int id);
}
